#define _CRT_SECURE_NO_WARNINGS 1
#include <iostream>
#include <cstdio>
#include <stack>
#include <cmath>
#include <string>
#include <cstring>
#include <vector>
#include <algorithm>
using namespace std;
#define ll long long

//int T, n,r[5],id[5], l[5];
//ll tot, t;
//ll a[200010], b[200010], c[200010];
//bool f(ll a[], ll b[], ll c[], int x, int y, int z) {
//	l[1] = 1;
//	r[1] = lower_bound(a + 1, a + 1 + n, t) - a;
//	if (r[1] >= n)
//		return 0;
//	l[2] = r[1] + 1;
//	r[2] = lower_bound(b + r[2], b + n + 1, t) - b;
//	if (r[2] >= n)
//		return 0;
//	if (c[n] - c[r[2]] < t)
//		return 0;
//	l[3] = r[2] + 1;
//	r[3] = n;
//	id[x] = 1, id[y] = 2, id[z] = 3;
//	cout << l[id[1]] << ' ' << r[id[1]] << ' ' << l[id[2]] << ' ' << r[id[2]] << ' ' << l[id[3]] << ' ' << r[id[3]] << '\n';
//	return 1;
//	
//}
//int main() {
//	ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
//	cin >> T;
//	while (T--) {
//		cin >> n;
//		for (int i = 1; i <= n; i++) cin >> a[i], a[i] += a[i - 1],tot+=a[i];
//		for (int i = 1; i <= n; i++) cin >> b[i], b[i] += b[i - 1];
//		for (int i = 1; i <= n; i++) cin >> c[i], c[i] += c[i - 1];
//		ll t = (tot+2) / 3;
//		if (f(a, b, c, 1, 2, 3) || f(a, c, b, 1, 3, 2) || f(b, a, c, 2, 1, 3) || f(b, c, a, 2, 3, 1) || f(c, a, b, 3, 1, 2) || f(c, b, a, 3, 2, 1))
//			continue;
//		cout << -1 << '\n';
//	}
//	return 0;
//}
//int t, n, a[50];
//int main() {
//	cin >> n;
//	for (int i = 1; i <= n; i++)
//	{
//		cin >> a[i];
//	}
//	int r = lower_bound(a+1 , a+1  + n , 4) - (a+1);
//	printf("%d",r );
//	return 0;
//}

int t, n, l[5], r[5], id[5];
ll a[200005], b[200005], c[200005], tot;
bool f(ll a[], ll b[], ll c[], int id1, int id2, int id3) {
	l[1] = 1, r[1] = lower_bound(a + 1, a + 1 + n, tot) - a;
	if (r[1] >= n)
		return 0;
	l[2] = r[1] + 1, r[2] = lower_bound(b + l[2], b + 1 + n, tot + b[r[1]]) - b;
	if (r[2] >= n)
		return 0;
	if (c[n] - c[r[2]] < tot)
		return 0;
	l[3] = r[2] + 1, r[3] = n;
	id[id1] = 1, id[id2] = 2, id[id3] = 3; 
	cout << l[id[1]] << ' ' << r[id[1]] << ' ' << l[id[2]] << ' ' << r[id[2]] << ' ' << l[id[3]] << ' ' << r[id[3]] << '\n'; 
	return 1;
}
int main() {
	ios::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	cin >> t;
	while (t--) {
		cin >> n;
		for (int i = 1; i <= n; ++i)
			cin >> a[i], a[i] += a[i - 1];
		for (int i = 1; i <= n; ++i)
			cin >> b[i], b[i] += b[i - 1];
		for (int i = 1; i <= n; ++i)
			cin >> c[i], c[i] += c[i - 1];
		tot = (a[n] + 2) / 3;
		if (f(a, b, c, 1, 2, 3) || f(a, c, b, 1, 3, 2) || f(b, a, c, 2, 1, 3) || f(b, c, a, 2, 3, 1) || f(c, a, b, 3, 1, 2) || f(c, b, a, 3, 2, 1)) 
			continue;
		cout << "-1\n";
	}
	return 0;
}